<?php

 
 Zend_Loader::loadClass("BaseDBRows");
 Zend_Loader::loadClass("UserType");
 class UserTypes extends BaseDBRows
 {
 	protected function setUp()
 	{
 		$this->_tableName = UserType::_tablename;
 	}	
	
	public function getUserTypesArray($code, $value)
	{
		$query = new QueryCreator();
		$query->addFrom($this->_tableName);
		
		$query->addSelect("id, code");
		$query->addOrderBy("code");
		
		$db = DBCon::instance();
		$result = $db->query($query->createSQL());
		
		$data = array();
		if ($result) {
			while ($row = $result->fetch(Zend_Db::FETCH_OBJ)) {
				$data[$row->$code] = $row->$value;
			}
		}
		return $data;
	}
	
 }
?>